import {Entity, PrimaryGeneratedColumn, Column, ManyToOne, BaseEntity} from 'typeorm';
import { GoodsBrand } from './goods-brand.entity';
import { GoodsCategory } from './goods-category.entity';

@Entity()
export class GoodsSPU extends BaseEntity {
    @PrimaryGeneratedColumn()
    id: number;

    @Column()
    name: string;

    @Column()
    sn: string;

    @Column()
    salesCount: number;

    @Column()
    salesUnit: number;

    @Column()
    price: number;

    @Column()
    publishStatus: number;

    @Column()
    cover: string;

    @Column()
    album: string;

    @Column()
    details: string;

    @Column()
    status: number;

    @ManyToOne(() => GoodsBrand)
    brand: GoodsBrand;

    @ManyToOne(() => GoodsCategory)
    category: GoodsCategory;
}
